package xyz.riceball.job.service;

import com.baomidou.mybatisplus.extension.service.IService;
import xyz.riceball.job.entity.po.JobLogPO;
import xyz.riceball.job.entity.po.JobTriggerPO;

import java.time.LocalDateTime;


/**
 * 定时任务调度日志表 Service接口层
 *
 * @author xiaovcloud
 * @since 2022-06-16 19:02:39
 */
public interface JobLogService extends IService<JobLogPO> {
    /**
     * 保存成功日志
     *
     * @param jobTriggerPO
     * @param startTime
     * @param executorTime
     * @param jobMessage
     * @return
     */
    boolean logSuccess(JobTriggerPO jobTriggerPO, LocalDateTime startTime, LocalDateTime executorTime, String jobMessage);

    /**
     * 保存失败的日志
     *
     * @param jobTriggerPO
     * @param startTime
     * @param executorTime
     * @param jobMessage
     * @param exceptionInfo
     * @return
     */
    boolean logError(JobTriggerPO jobTriggerPO, LocalDateTime startTime, LocalDateTime executorTime, String jobMessage, String exceptionInfo);

}

